Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox


Pascal Summary

Constants

CONST
      kFix1                         = $00010000;{fixed point value equal }
                                                { to 1.0}
      gestaltQuickTime              = 'qtim';   {Movie Toolbox availability}

      MovieFileType                 = 'MooV';   {movie file type}

      VideoMediaType                = 'vide';   {video media type}
      SoundMediaType                = 'soun';   {sound media type}
      MediaHandlerType              = 'mhlr';   {media handler type}
      DataHandlerType               = 'dhlr';   {data handler type}
      TextMediaType                 = 'text';   {text media type}
      GenericMediaType              = 'gnrc';   {base media handler type}
DoTheRightThing = 0L                      {indicates default flag }
                                                { setting for Movie }
                                                { Toolbox functions}
{progress procedure messages}
      movieProgressOpen             = 0;        {start of a long operation}
      movieProgressUpdatePercent    = 1;        {completion data to }
                                                { procedure} 
      movieProgressClose            = 2;        {end of a long operation}
{progress procedure operations that indicate which routine }
      { your application has called}
      progressOpFlatten             = 1;        {FlattenMovie or }
                                                { FlattenMovieData}
      progressOpInsertTrackSegment  = 2;        {InsertTrackSegment} 
      progressOpInsertMovieSegment  = 3;        {InsertMovieSegment}
      progressOpPaste               = 4;        {PasteMovieSelection}
      progressOpAddMovieSelection   = 5;        {AddMovieSelection}
      progressOpCopy                = 6;        {CopyMovieSelection}
      progressOpCut                 = 7;        {CutMovieSelection}
      progressOpLoadMovieIntoRam    = 8;        {LoadMovieIntoRam}
      progressOpLoadTrackIntoRam    = 9;        {LoadTrackIntoRam}
      progressOpLoadMediaIntoRam    = 10;       {LoadMediaIntoRam}
      progressOpImportMovie         = 11;       {ConvertFileToMovieFile}
      progressOpExportMovie         = 12;       {ConvertMovieFile}
{NewMovie function flags}
      newMovieActive                    = $1;   {is new movie active?}
      newMovieDontResolveDataRefs       = $2;   {how data references are }
                                                { resolved in movie resource}
      newMovieDontAskUnresolvedDataRefs = $4;   {is user asked to locate }
                                                { files? }
      newMovieDontAutoAlternate         = $8;   {are enabled tracks }
                                                { selected from alternate }
                                                { groups?}
      
      {sound volume values in trackVolume parameter of NewMovieTrack }
      { function}
      kFullVolume                       = $100; {full, natural volume }
                                                { 8.8 format}  
      kNoVolume                         = 0;    {sets track to no volume} 

      {constants for whichMediaTypes parameter of }
      { GetMovieNextInterestingTime function}
      VisualMediaCharacteristic 'eyes'          {visual media type}
      AudioMediaCharacteristic 'ears'           {audio media type}

      {track usage flags in SetTrackUsage procedure}
      trackUsageInMovie                 = $2;   {track is used in movie}
      trackUsageInPreview               = $4;   {track is used in preview}
      trackUsageInPoster                = $8;   {track is used in poster}
{media sample flags in AddMediaSample function}
      mediaSampleNotSync                = 1;    {sample to be added not a }
                                                { sync sample}
      mediaSampleShadowSync             = 2;    {sample is a shadow }
                                                { sync sample}
{media quality settings in quality parameter of }
      { SetMediaQuality procedure} 
      mediaQualityDraft                 = $0000; {lowest quality level}
      mediaQualityNormal                = $0040; {acceptable quality level}
      mediaQualityBetter                = $0080; {better quality level}
      mediaQualityBest                  = $00C0; {best quality level}
{interesting times flags in interestingTimeFlags parameter }
      { of GetMovieNextInterestingTime procedure specify searching criteria}
      nextTimeMediaSample            = $1;       {next sample in movie's }
                                                 { media}
      nextTimeMediaEdit              = $2;       {next sample group in media}
      nextTimeTrackEdit              = $4;       {sample for next entry }
                                                 { in edit list}
      nextTimeSyncSample             = $8;       {next sync sample in }
                                                 { movie's media}
      nextTimeEdgeOK                 = $2000;    {get specified time }
                                                 { element data}
      nextTimeIgnoreActiveSegment    = $4000;    {outside active segment}
{flag for resID parameter of NewMovieFile function}
      movieInDataForkResID           = -1;       {magic resource ID}
{movie-creation flags from CreateMovieFile function}
      createMovieFileDeleteCurFile   = $80000000;{delete existing file?} 
      createMovieFileDontCreateMovie = $40000000;{new movie created?}
      createMovieFileDontOpenFile    = $20000000;{new movie file opened?}
{movie-flattening flags from FlattenFlags procedure}
      flattenAddMovieToDataFork      = $1;       {movie in data fork of }
                                                 { new movie file}
      flattenActiveTracksOnly        = $4;       {enabled tracks added }
                                                 { to movie file}
      flattenDontInterleaveFlatten   = $8;       {disables data }
                                                 { storage optimizations}
{movie scrap flags from PutMovieOnScrap function}
      movieScrapDontZeroScrap        = $1;   {is scrap cleared before }
                                             { movie on scrap?}
      movieScrapOnlyPutMovie         = $2;   {are other items on }
                                             { scrap with movie?}
mediaHandlerFlagGenericClient = 1;  {component flag--should be set }
                                          { for all media handlers }
                                          { components that use generic }
                                          { media handlers}
{callback flags from CallMeWhen function specify when callback }
      { should be called}
      triggerTimeFwd                 = $0001;    {time is at positive rate}
      triggerTimeBwd                 = $0002;    {time is at negative rate}
      triggerTimeEither              = $0003;    {without regard to rate}
      triggerRateLT                  = $0004;    {whenever rate changes}
      triggerRateGT                  = $0008;    {rate change less than }
                                                 { param2}
      triggerRateEqual               = $0010;    {rate change equal to }
                                                 { param2}
      triggerRateLTE                 = $0014;    {rate change less than or }
                                                 { equal to param2} 
      triggerRateGTE             = $0018; {rate change greater than }
                                          { or equal to param2 specification}
      triggerRateNotEqual        = $001C; {rate change not equal to param2}
      triggerRateChange          = 0;     {whenever rate changes}
      triggerAtStart             = $0001; {at start time}
      triggerAtStop              = $0002; {at stop time}
{flags returned by GetTimeBaseStatus function specify where }
      { time value in time record lies}
      timeBaseBeforeStartTime    = 1;     {before start time of time base} 
      timeBaseAfterStopTime      = 2;     {after stop time of time base}
{values for cbType parameter of NewCallBack function specify when }
      { event can be invoked}
      callBackAtTime             = 1;     {at a specified time}
      callBackAtRate             = 2;     {rate for time base reaches value}
      callBackAtTimeJump         = 3;     {when time value changes }
                                          { by amount differing from }
                                          { its rate}
      callBackAtExtremes         = 4;     {at start time, at stop time, }
                                          { or both}
      callBackAtInterrupt        = $8000; {at interrupt time}
{values for callBackFlags field of QuickTime callback header record }
      { used by clock components to communicate scheduling information }
      { about a callback event to the Movie Toolbox}
      qtcbNeedsRateChanges       = 1;     {rate changes}
      qtcbNeedsTimeChanges       = 2;     {time changes}
      qtcbNeedsStartStopChanges  = 4;;    {changes in time base start/stop}
{dialog items to include in dialog box definition for use with }
      { SFPGetFilePreview function}
      sfpItemPreviewAreaUser     = 11;    {user preview area}
      sfpItemPreviewStaticText   = 12;    {static text preview}
      sfpItemPreviewDividerUser  = 13;    {user divider preview}
      sfpItemCreatePreviewButton = 14;    {create preview button}
      sfpItemShowPreviewButton   = 15;    {show preview button}
{control flags for timeBaseFlags parameter of SetTimeBaseFlags }
      { function}
      loopTimeBase               = 1;     {whether time base loops}
      palindromeLoopTimeBase     = 2;     {whether time base loops }
                                          { in palindrome fashion}

      {flags for LoadIntoRAM functions}
      keepInRam                  = 1;     {load and make so data cannot be }
                                          { purged}
      unkeepInRam                = 2;     {mark data so it can be purged}
      flushFromRam               = 4;     {empty handles and purge data }
                                          { from memory}
      loadForwardTrackEdits      = 8;     {load only data around track }
                                          { edits--play movie forward}
      loadBackwardTrackEdits     = 16;    {load only data around track}
                                          { edits--play movie in reverse}

      {flag for PasteHandleIntoMovie function}
      pasteInParallel            = 1;     {changes function to take }
                                          { contents and type of handle }
                                          { and add to movie}
{text description display flags used in AddTextSample and }
      { AddTESample functions}
      dfDontDisplay              = 1;     {don't display the text}
      dfDontAutoScale            = 2;     {don't scale text as track }
                                          { boundaries grow or shrink}
      dfClipToTextBox            = 4;     {clip update to the text box}
      dfUseMovieBGColor          = 8;     {set text background to }
                                          { movie's background color}
      dfShrinkTextBoxToFit       = 16;    {compute minimum box to fit }
                                          { the sample}
      dfScrollIn                 = 32;    {scroll text in until last }
                                          { of text is in view}
      dfScrollOut                = 64;    {scroll text out until last }
                                          { of text is gone}
      dfHorizScroll              = 128;   {scroll text horizontally}
      dfReverseScroll            = 256;   {vertical text scrolls down, }
                                          { horizontal text scrolls }
                                          { backward;justification dependent}
{values returned by the GetMatrixType function}
      identityMatrixType         = $00;   {matrix is identity}
      translateMatrixType        = $01;   {matrix translates}
      scaleMatrixType            = $02;   {matrix scales}
      scaleTranslateMatrixType   = $03;   {matrix scales and translates}
      linearMatrixType           = $04;   {matrix is general 2 x 2}
      linearTranslateMatrixType  = $05;   {matrix is general 2 x 2 }
                                          { and translates}
      perspectiveMatrixType      = $06;   {matrix is general 3 x 3}
{return display flags for application-defined text function}
      txtProcDefaultDisplay      = 0;     {use the media's default settings}
      txtProcDontDisplay         = 1;     {don't display the text}
      txtProcDoDisplay           = 2;     {do display the text}
{find flags for FindNextTextFunction}
      findTextEdgeOK             = 1;     {OK to find text at specified }
                                          { sample time}
      findTextCaseSensitive      = 2;     {case-sensitive search}
      findTextReverseSearch      = 4;     {search from sample time backward}
      findTextWrapAround         = 8;     {wrap search when beginning or }
                                          { end of movie is reached}
{hints constants for play hints functions}
      hintsScrubMode             = $1;    {toolbox can display key frames }
                                          { when movie is repositioned}
      hintsAllowInterlace        = $40;   {use interlace option for }
                                          { compressor components}
      hintsUseSoundInterp        = $80;   {turns on sound interpolation}

Data Types

TYPE  Movie          = ^MovieRecord;         {movie identifier}
      Track          = ^TrackRecord;         {track identifer}
      Media          = ^MediaRecord;         {media identifier}
      UserData       = ^UserDataRecord;      {user data list identifier}
      TrackEditState = ^TrackEditStateRecord;{track edit state identifier}
      MovieEditState = ^MovieEditStateRecord;{movie edit state identifier}
      TimeValue      = LongInt;              {time value}
      TimeScale      = LongInt;              {time scale in time record}
      TimeBase       = ^TimeBaseRecord;      {time base identifier}
      TimeBaseStatus = LongInt;              {time base statistics}
      QTCallBack     = ^CallBackRecord;      {callback identifier}
      QTCallBackProc             = procPtr;        {callback function }
                                                   { identifier}
      Int64                      = CompTimeValue;  {time value in time }
                                                   { record}
      playHintsEnum              = LongInt;        {play hints enumeration}
      movieFlattenFlagsEnum      = LontInt;        {movie flatteners flags }
                                                   { enumeration}
      createMovieFileFlagsEnum   = LongInt;        {movie creation flags}
      nextTimeFlagsEnum          = Byte;           {next time flags}
Int64 = 
      RECORD 
         hi:         LongInt; {high-order bits of value field in time record}
         lo:         LongInt; {low-order bits of value field in time record}
      END; 
TimeRecord = 
      RECORD
         value:         CompTimeValue; {time value as duration or }
                                       { absolute time}
         scale:         TimeScale;     {time scale as time units}
         base:          TimeBase;      {reference to the time base}
      END;
SampleDescriptionPtr= ^SampleDescription;{ptr to sample description}
      SampleDescriptionHandle = ^SampleDescriptionPtr;{handle to sample }
                                                      { description record}
SampleDescription = 
      RECORD
         descSize:      LongInt;       {total size in bytes of this record}
         dataFormat:    LongInt;       {format of the sample data}
         resvd1:        LongInt;       {reserved--set to 0}
         resvd2:        Integer;       {reserved--set to 0}
         dataRefIndex:  Integer;       {reserved--set to 1}
END;
SoundDescriptionPtr     = ^SoundDescription; {ptr to sound description}
      SoundDescriptionHandle  = ^SoundDescriptionPtr; {handle to sound }
                                                      { description record}
SoundDescription = 
         RECORD
            descSize:         LongInt; {total size in bytes of this record}
            dataFormat:       LongInt; {format of the sound data}
            resvd1:           LongInt; {reserved--set to 0}
            resvd2:           Integer; {reserved--set to 0}
            dataRefIndex:     Integer; {reserved--set to 1}
            version:          Integer; {which version is this data? }
                                       { (set to 0)}
            revlevel:         Integer; {which version of the compressor }
                                       { component did this? (set to 0)}
            vendor:           LongInt; {whose compressor component }
                                       { compressed this data? (set to 0)}
            numChannels:      Integer; {number of sound channels}
            sampleSize:       Integer; {number of bits in each sample;}
            compressionID:    Integer; {sound compression used--0 if none}
            packetSize:       Integer; {packet size for compression--0 if }
                                       { no compression}
            sampleRate:       Fixed;   {rate at which sound samples }
                                       { were obtained}
         END;
TextDescriptionPtr = ^TextDescription;
TextDescriptionHandle = ^TextDescriptionPtr;
   TextDescription = 
      RECORD
         descSize:            LongInt;       {total size of this text }
                                             { description record}
         dataFormat:          LongInt;       {type of data in this record }
                                             { ('text')}
         resvd1:              LongInt;       {reserved for use by Apple-- }
                                             { set to 0}
         resvd2:              Integer;       {reserved for use by Apple-- }
                                             { set to 0}
         dataRefIndex:        Integer;       {index to data references}
         displayFlags:        LongInt;       {display flags for text}
         textJustification:   LongInt;       {text justification flags}
         bgColor:             RGBColor;      {background color}
         defaultTextBox:      Rect;          {location of the text within }
                                             { track bounds}
         defaultStyle:        ScrpSTElement; {default style (TextEdit }
                                             { record)}
      END;
MovieProgressProcPtr    = ProcPtr;  {pointer to application-defined }
                                          { movie progress procedure}
MovieRgnCoverProc       = ProcPtr;  {a pointer to application-defined }
                                          { cover procedure}
MediaInformationHandle  = Handle;            {data returned }
                                                   { by media handler}
      MediaHandler            = ComponentInstance; {media handler}
      MediaHandlerComponent   = Component;         {media handler component}
      DataHandler             = ComponentInstance; {data handler}
      DataHandlerComponent    = Component;         {data handler component}
      HandlerError            = ComponentResult;   {error handler}
MovieController         = ComponentInstance; {movie controller}
ErrorProcPtr            = ProcPtr;  {pointer to application-defined }
                                          { error-notification procedure}
      MoviePreviewCallOutProc = ProcPtr;  {pointer to application-defined }
                                          { movie preview callout procedure}
      TimeBaseFlags           = Char;     {control flags for time base}
      QTCallBackProc          = ProcPtr;  {pointer to application-defined } 
                                          { callback routine}
      QTCallBackHeader = 
      RECORD
         callBackFlags:       LongInt;    {flags used by clock component to }
                                          { communicate scheduling data }
                                          { about callback to Movie Toolbox}
         reserved1:           LongInt;    {reserved for use by Apple}
         qtPrivate:           PACKED ARRAY[0..39] of Byte;
                                          {reserved for use by Apple}
      END;
MatrixRecordPtr         = ^MatrixRecord;  {pointer to matrix record}
      
      MatrixRecord = 
      RECORD
         matrix:              ARRAY[0..2,0..2] of Fixed;
      END;

      FixedPoint = 
      RECORD
         x:             Fixed;   {point's x coordinate as fixed-point number}
         y:             Fixed;   {point's y coordinate as fixed-point number}
      END;
FixedRect = 
      RECORD
         left:    Fixed;   {x coordinate of rectangle's upper-left corner}
         top:     Fixed;   {y coordinate of rectangle's upper-left corner}
         right:   Fixed;   {x coordinate of rectangle's lower-right corner}
         bottom:  Fixed;   {y coordinate of rectangle's lower-right corner}
      END;

Routines for Getting and Playing Movies

Initializing the Movie Toolbox

FUNCTION EnterMovies: 		OSErr;
PROCEDURE ExitMovies;

Error Routines

FUNCTION GetMoviesError:	OSErr;
FUNCTION GetMoviesStickyError: 
				OSErr;
PROCEDURE ClearMoviesStickyError;
PROCEDURE SetMoviesErrorProc
				(errProc: ErrorProcPtr; refcon: LongInt);

Movie Routines

FUNCTION NewMovieFromFile 	(VAR theMovie: Movie; resRefNum: Integer; 
				VAR resId: Integer; resName: Str255; 
				newMovieFlags: Integer; 
VAR dataRefWasChanged: Boolean): 		OSErr;
FUNCTION NewMovieFromHandle
				(VARh: Handle; newMovieFlags: LongInt; 
				VAR dataRefWasChanged: Boolean): OSErr;
FUNCTION NewMovie 		(newMovieFlags: LongInt): Movie;
FUNCTION ConvertFileToMovieFile
				(inputFile: FSSpec; outputFile: FSSpec;	
				creator: OSType; scriptTag: ScriptCode; 
				VAR resID: Integer; flags: LongInt; 
				userComp: ComponentInstance; 
				proc: ProcPtr; refcon: LongInt): OSErr;
FUNCTION ConvertMovieToFile
				(theMovie: Movie; onlyTrack: Track; 
				outputFile: FSSpec; fileType: OSType; 
				creator: OSType; scriptTag: ScriptCode; 
				VAR resID: Integer; flags: LongInt; 
				userComp: ComponentInstance): OSErr;
PROCEDURE DisposeMovie 		(theMovie: Movie);
FUNCTION CreateMovieFile 	(fileSpec: FSSpec; creator: OSType; 
				scriptTag: ScriptCode; 
				createMovieFileFlags: LongInt; 
				VAR resRefNum: Integer; 
				VAR newMovie: Movie): OSErr;
FUNCTION OpenMovieFile		(fileSpec: FSSpec; VAR resRefNum: Integer; 
				perms: SignedByte): OSErr;
FUNCTION CloseMovieFile 	(resRefNum: Integer): OSErr;
FUNCTION DeleteMovieFile 	(fileSpec: FSSpec): OSErr;

Saving Movies

FUNCTION HasMovieChanged 	(theMovie: Movie): Boolean;
PROCEDURE ClearMovieChanged
				(theMovie: Movie);
FUNCTION AddMovieResource 	(theMovie: Movie; resRefNum: Integer; 
				VAR resId: Integer; resName: Str255): OSErr;
FUNCTION UpdateMovieResource
				(theMovie: Movie; resRefNum: Integer; 
				VAR resId: Integer; resName: Str255): OSErr;
FUNCTION RemoveMovieResource
				(resRefNum: Integer; resId: Integer): OSErr;
FUNCTION PutMovieIntoHandle
				(theMovie: Movie; publicMovie: Handle): OSErr;
PROCEDURE FlattenMovie 		(theMovie: Movie; movieFlattenFlags: LongInt; 
				theFile: FSSpec; creator: OSType; 
				scriptTag: ScriptCode; 
				createMovieFileFlags: LongInt; 
				VAR resId: Integer; resName: Str255);
FUNCTION FlattenMovieData 	(theMovie: Movie; movieFlattenFlags: LongInt; 
				theFile: FSSpec; creator: OSType; 
				scriptTag: ScriptCode; 
				createMovieFileFlags: LongInt): Movie;
FUNCTION NewMovieFromDataFork
				(VAR theMovie: Movie; fRefNum: Integer; 
				fileOffset: Integer; newMovieFlags: Integer; 
				VAR dataRefWasChanged: Boolean): OSErr;
FUNCTION PutMovieIntoDataFork
				(theMovie: Movie; fRefNum: Integer; 
				offset: LongInt; maxSize: LongInt): OSErr;

Controlling Movie Playback

PROCEDURE StartMovie 		(theMovie: Movie);
PROCEDURE StopMovie 		(theMovie: Movie);
PROCEDURE GoToBeginningOfMovie
				(theMovie: Movie);
PROCEDURE GoToEndOfMovie	(theMovie: Movie);

Movie Posters and Movie Previews

PROCEDURE SetTrackUsage 	(theTrack: Track; usage: LongInt);
FUNCTION GetTrackUsage 		(theTrack: Track): LongInt;
PROCEDURE ShowMoviePoster 	(theMovie: Movie);
PROCEDURE SetPosterBox 		(theMovie: Movie; boxRect: Rect);
PROCEDURE GetPosterBox 		(theMovie: Movie; VAR boxRect: Rect);
PROCEDURE SetMoviePosterTime
				(theMovie: Movie; posterTime: TimeValue);
FUNCTION GetMoviePosterTime 
				(theMovie: Movie): TimeValue;
PROCEDURE PlayMoviePreview 	(theMovie: Movie; 
				callOutProc: MoviePreviewCallOutProc; 
				refcon: LongInt);
PROCEDURE SetMoviePreviewMode
				(theMovie: Movie; usePreview: Boolean);
FUNCTION GetMoviePreviewMode
				(theMovie: Movie): Boolean;
PROCEDURE SetMoviePreviewTime 
				(theMovie: Movie; previewTime: TimeValue; previewDuration: TimeValue);
PROCEDURE GetMoviePreviewTime 
				(theMovie: Movie; VAR previewTime: TimeValue; 
				VAR previewDuration: TimeValue);

Movies and Your Event Loop

PROCEDURE MoviesTask 		(theMovie: Movie; maxMilliSecToUse: LongInt);
FUNCTION IsMovieDone 		(theMovie: Movie): Boolean;
FUNCTION UpdateMovie	 	(theMovie: Movie): OSErr;
FUNCTION PtInMovie 		(theMovie: Movie; pt: Point): Boolean;
FUNCTION PtInTrack 		(theTrack: Track; pt: Point): Boolean;
FUNCTION GetMovieStatus 	(theMovie: Movie; 
					VAR firstProblemTrack: Track): ComponentResult;
FUNCTION GetTrackStatus 	(theTrack: Track): ComponentResult;

Preferred Movie Settings

PROCEDURE SetMoviePreferredRate 
				(theMovie: Movie; rate: Fixed);
FUNCTION GetMoviePreferredRate 
				(theMovie: Movie): Fixed;
PROCEDURE SetMoviePreferredVolume 
				(theMovie: Movie; volume: Integer);
FUNCTION GetMoviePreferredVolume 
				(theMovie: Movie): Integer;

Enhancing Movie Playback Performance

FUNCTION PrerollMovie 		(theMovie: Movie; time: TimeValue; 
				Rate: Fixed): OSErr;
PROCEDURE SetMovieActiveSegment 
				(theMovie: Movie; startTime: TimeValue; 
				duration: TimeValue);
PROCEDURE GetMovieActiveSegment 
				(theMovie: Movie; VAR startTime: TimeValue; 
				VAR duration: TimeValue);
PROCEDURE SetMoviePlayHints
				(theMovie: Movie; flags: LongInt; 
				flagsMask: LongInt); 
PROCEDURE SetMediaPlayHints 
				(theMedia: Media; flags: LongInt; flagsMask: LongInt); 
FUNCTION LoadMovieIntoRam 	(theMovie: Movie; time: TimeValue; 
				duration: TimeValue; flags: LongInt): OSErr;
FUNCTION LoadTrackIntoRam 	(theTrack: Track; time: TimeValue; 
				duration: TimeValue; flags: LongInt): OSErr;
FUNCTION LoadMediaIntoRam 	(theMedia: Media; time: TimeValue; 
				duration: TimeValue; flags: LongInt): OSErr;
FUNCTION SetMediaShadowSync
				(theMedia: Media; frameDiffSampleNum: LongInt; syncSampleNum: LongInt): OSErr;
FUNCTION GetMediaShadowSync
				(theMedia: Media; frameDiffSampleNum: LongInt; 
				VAR syncSampleNum: LongInt): OSErr;

Disabling Movies and Tracks

PROCEDURE SetMovieActive 	(theMovie: Movie; active: Boolean);
FUNCTION GetMovieActive 	(theMovie: Movie): Boolean;
PROCEDURE SetTrackEnabled 	(theTrack: Track; isEnabled: Boolean);
FUNCTION GetTrackEnabled 	(theTrack: Track): Boolean;

Generating Pictures From Movies

FUNCTION GetMoviePict 		(theMovie: Movie; time: TimeValue): PicHandle;
FUNCTION GetMoviePosterPict
				(theMovie: Movie): PicHandle;
FUNCTION GetTrackPict 		(theTrack: Track; time: TimeValue): PicHandle;

Creating Tracks and Media Structures

FUNCTION NewMovieTrack 		(theMovie: Movie; width: Fixed; height: Fixed; 
				trackVolume: Integer): Track;
PROCEDURE DisposeMovieTrack 
				(theTrack: Track);
FUNCTION NewTrackMedia 		(theTrack: Track; mediaType: OSType; 
				timeScale: TimeScale; dataRef: Handle; 
				dataRefType: OSType): Media;
PROCEDURE DisposeTrackMedia
				(theMedia: Media);

Working With Progress and Cover Procedures

PROCEDURE SetMovieProgressProc 
				(theMovie: Movie; p: MovieProgressProcPtr; 
				refcon: LongInt);
PROCEDURE SetMovieCoverProcs
				(theMovie: Movie; uncoverProc: MovieRgnCoverProc; coverProc: MovieRgnCoverProc; refcon: LongInt);

Routines That Modify Movie Properties

Working With Movie Spatial Characteristics

PROCEDURE SetMovieGWorld 	(theMovie: Movie; port: CGrafPtr; 
				gdh: GDHandle);
PROCEDURE GetMovieGWorld 	(theMovie: Movie; VAR port: CGrafPtr; 
				VAR gdh: GDHandle);
PROCEDURE SetMovieBox 		(theMovie: Movie; boxRect: Rect);
PROCEDURE GetMovieBox 		(theMovie: Movie; VAR boxRect: Rect);
FUNCTION GetMovieDisplayBoundsRgn 
				(theMovie: Movie): RgnHandle;
FUNCTION GetMovieSegmentDisplayBoundsRgn 
				(theMovie: Movie; time: TimeValue; 
				duration: TimeValue): RgnHandle;
PROCEDURE SetMovieDisplayClipRgn 
				(theMovie: Movie; theClip: RgnHandle);
FUNCTION GetMovieDisplayClipRgn 
				(theMovie: Movie): RgnHandle;
FUNCTION GetTrackDisplayBoundsRgn 
				(theTrack: Track): RgnHandle;
FUNCTION GetTrackSegmentDisplayBoundsRgn 
				(theTrack: Track; time: TimeValue; 
				duration: TimeValue): RgnHandle;
PROCEDURE SetTrackLayer 	(theTrack: Track; layer: Integer);
FUNCTION GetTrackLayer	 	(theTrack: Track): Integer;
PROCEDURE SetMovieMatrix 	(theMovie: Movie; matrix: MatrixRecord);
PROCEDURE GetMovieMatrix 	(theMovie: Movie; VAR matrix: MatrixRecord);
FUNCTION GetMovieBoundsRgn 	(theMovie: Movie): RgnHandle;
FUNCTION GetTrackMovieBoundsRgn
				(theTrack: Track): RgnHandle;
PROCEDURE SetMovieClipRgn 	(theMovie: Movie; theClip: RgnHandle);
FUNCTION GetMovieClipRgn 	(theMovie: Movie): RgnHandle;
PROCEDURE SetTrackMatrix 	(theTrack: Track; matrix: MatrixRecord);
PROCEDURE GetTrackMatrix 	(theTrack: Track; VAR matrix: MatrixRecord);
FUNCTION GetTrackBoundsRgn 	(theTrack: Track): RgnHandle;
PROCEDURE SetTrackDimensions 
				(theTrack: Track; width: Fixed; height: Fixed);
PROCEDURE GetTrackDimensions
				(theTrack: Track; VAR width: Fixed; 
				VAR height: Fixed);
PROCEDURE SetTrackClipRgn	(theTrack: Track; theClip: RgnHandle);
FUNCTION GetTrackClipRgn 	(theTrack: Track): RgnHandle;
PROCEDURE SetTrackMatte 	(theTrack: Track; theMatte: PixMapHandle);
FUNCTION GetTrackMatte 		(theTrack: Track): PixMapHandle;
PROCEDURE DisposeMatte 		(theMatte: PixMapHandle);

Working With Sound Volume

PROCEDURE SetMovieVolume 	(theMovie: Movie; volume: Integer);
FUNCTION GetMovieVolume 	(theMovie: Movie): Integer;
PROCEDURE SetTrackVolume 	(theTrack: Track; volume: Integer);
FUNCTION GetTrackVolume 	(theTrack: Track): Integer;

Working With Movie Time

FUNCTION GetMovieDuration 	(theMovie: Movie): TimeValue;
PROCEDURE SetMovieTimeValue 
				(theMovie: Movie; newtime: TimeValue);
PROCEDURE SetMovieTime 		(theMovie: Movie; newtime: TimeRecord);
FUNCTION GetMovieTime 		(theMovie: Movie; VAR currentTime: TimeRecord): 
				TimeValue;
PROCEDURE SetMovieRate	 	(theMovie: Movie; rate: Fixed);
FUNCTION GetMovieRate 		(theMovie: Movie): Fixed;
PROCEDURE SetMovieTimeScale
				(theMovie: Movie; timeScale: TimeScale);
FUNCTION GetMovieTimeScale 	(theMovie: Movie): TimeScale;
FUNCTION GetMovieTimeBase 	(theMovie: Movie): TimeScale;

Working With Track Time

FUNCTION GetTrackDuration 	(theTrack: Track): TimeValue;
PROCEDURE SetTrackOffset 	(theTrack: Track; movieOffsetTime: TimeValue);
FUNCTION GetTrackOffset 	(theTrack: Track): TimeValue;
FUNCTION TrackTimeToMediaTime 
				(value: TimeValue; theTrack: Track): TimeValue;

Working With Media Time

FUNCTION GetMediaDuration	 (theMedia: Media): TimeValue;
PROCEDURE SetMediaTimeScale
				(theMedia: Media; timeScale: TimeScale);
FUNCTION GetMediaTimeScale 	(theMedia: Media): TimeScale;

Finding Interesting Times

PROCEDURE GetMovieNextInterestingTime 
				(theMovie: Movie; interestingTimeFlags: Integer; 
				numMediaTypes: Integer; 
				whichMediaTypes: OSTypePtr; time: TimeValue; rate: Fixed; VAR interestingTime: TimeValue; VAR interestingDuration: TimeValue);
PROCEDURE GetTrackNextInterestingTime 
				(theTrack: Track; interestingTimeFlags: Integer; 
				time: TimeValue; rate: Fixed; 
				VAR interestingTime: TimeValue; 
				VAR interestingDuration: TimeValue);
PROCEDURE GetMediaNextInterestingTime 
				(theMedia: Media; interestingTimeFlags: Integer; 
				time: TimeValue; rate: Fixed; 
				VAR interestingTime: TimeValue; 
				VAR interestingDuration: TimeValue);

Locating a Movie's Tracks and Media Structures

FUNCTION GetMovieTrackCount
				(theMovie: Movie): LongInt;
FUNCTION GetMovieIndTrack 	(theMovie: Movie; index: LongInt): Track;
FUNCTION GetMovieTrack 		(theMovie: Movie; trackID: LongInt): Track;
FUNCTION GetTrackID 		(theTrack: Track): LongInt;
FUNCTION GetTrackMovie 		(theTrack: Track): Movie;
FUNCTION GetTrackMedia		(theTrack: Track): Media;
FUNCTION GetMediaTrack 		(theMedia: Media): Track;

Working With Alternate Tracks

PROCEDURE SetMovieLanguage 	(theMovie: Movie; language: LongInt);
PROCEDURE SelectMovieAlternates 
				(theMovie: Movie);
PROCEDURE SetAutoTrackAlternatesEnabled 
				(theMovie: Movie; enable: Boolean);
PROCEDURE SetTrackAlternate
				(theTrack: Track; alternateT: Track);
FUNCTION GetTrackAlternate	 (theTrack: Track): Track;
PROCEDURE SetMediaLanguage		(theMedia: Media; language: Integer);
FUNCTION GetMediaLanguage 	(theMedia: Media): Integer;
PROCEDURE SetMediaQuality	(theMedia: Media; quality: Integer);
FUNCTION GetMediaQuality 	(theMedia: Media): Integer;

Working With Data References

FUNCTION AddMediaDataRef	(theMedia: Media; VAR index: Integer; 
				dataRef: Handle; dataRefType: OSType): OSErr;
FUNCTION SetMediaDataRef	(theMedia: Media; index: Integer; 
				dataRef: Handle; dataRefType: OSType): OSType;
FUNCTION GetMediaDataRefCount 
				(theMedia: Media; VAR count: Integer): OSErr;
FUNCTION GetMediaDataRef 	(theMedia: Media; index: Integer; 
				VAR dataRef: Handle; VAR dataRefType: OSType; 
				VAR dataRefAttributes: LongInt): OSErr;

Determining Movie Creation and Modification Time

FUNCTION GetMovieCreationTime
				(theMovie: Movie): LongInt;
FUNCTION GetMovieModificationTime 
				(theMovie: Movie): LongInt;
FUNCTION GetTrackCreationTime 
				(theTrack: Track): LongInt;
FUNCTION GetTrackModificationTime 
				(theTrack: Track): LongInt;
FUNCTION GetMediaCreationTime 
				(theMedia: Media): LongInt;
FUNCTION GetMediaModificationTime 
				(theMedia: Media): LongInt;

Working With Media Samples

FUNCTION GetMovieDataSize 	(theMovie: Movie; startTime: TimeValue; 
				duration: TimeValue): LongInt;
FUNCTION GetTrackDataSize 	(theTrack: Track; startTime: TimeValue; 
				duration: TimeValue): LongInt;
FUNCTION GetMediaDataSize 	(theMedia: Media; startTime: TimeValue; 
				duration: TimeValue): LongInt;
FUNCTION GetMediaSampleCount 
				(theMedia: Media): LongInt;
FUNCTION GetMediaSampleDescriptionCount 
				(theMedia: Media): LongInt;
PROCEDURE GetMediaSampleDescription 
				(theMedia: Media; index: LongInt; 
				descH: SampleDescriptionHandle);
FUNCTION SetMediaSampleDescription
				(theMedia: Media; index: LongInt; 
				descH: SampleDescriptionHandle): OSErr;
PROCEDURE MediaTimeToSampleNum 
				(theMedia: Media; time: TimeValue; 
				VAR sampleNum: LongInt; 
				VAR sampleTime: TimeValue; 
				VAR sampleDuration: TimeValue);
PROCEDURE SampleNumToMediaTime 
				(theMedia: Media; logicalSampleNum: LongInt; 
				VAR sampleTime: TimeValue; 
				VAR sampleDuration: TimeValue);

Working With Movie User Data

FUNCTION GetMovieUserData 	(theMovie: Movie): UserData;
FUNCTION GetTrackUserData 	(theTrack: Track): UserData;
FUNCTION GetMediaUserData 	(theMedia: Media): UserData;
FUNCTION GetNextUserDataType 
				(theUserData: UserData; 
				udType: OSType): LongInt; 
FUNCTION CountUserDataType 	(theUserData: UserData; 
				udType: OSType): Integer; 
FUNCTION AddUserData 	(theUserData: UserData; data: Handle; 
				udType: OSType): OSErr; 
FUNCTION GetUserData 	(theUserData: UserData; data: Handle; 
				udType: OSType; index: LongInt): OSErr; 
FUNCTION RemoveUserData 	(theUserData: UserData; udType: OSType; 
				index: LongInt): OSErr; 
FUNCTION AddUserDataText 	(theUserData: UserData; data: Handle; 
				udType: OSType; 
				index: LongInt; itlRegionTag: Integer): OSErr; 
FUNCTION GetUserDataText 	(theUserData: UserData; data: Handle; 
				udType: OSType; index: LongInt; 
				itlRegionTag: Integer): OSErr; 
FUNCTION RemoveUserDataText
				(theUserData: UserData; udType: OSType; 
				index: LongInt; itlRegionTag: Integer): OSErr;
FUNCTION SetUserDataItem	(theUserData: UserData; data: Ptr; 
				size: LongInt; udType: OSType; 
				index: LongInt): OSErr;
FUNCTION GetUserDataItem	(theUserData: UserData; data: Ptr; 
				size: LongInt; udType: OSType; index: long): 
				OSErr;
FUNCTION NewUserData		(VAR theUserData: UserData): OSErr;
FUNCTION DisposeUserData	(theUserData: UserData): OSErr;
FUNCTION PutUserDataIntoHandle
				(theUserData UserData; h Handle): OSErr;
FUNCTION NewUserDataFromHandle
				(h Handle; VAR theUserData: UserData): OSErr;

Routines for Editing Movies

Editing Movies

FUNCTION PutMovieOnScrap	 (theMovie: Movie; 
				movieScrapFlags: LongInt): OSErr;
FUNCTION NewMovieFromScrap 	(newMovieFlags: LongInt): Movie;
PROCEDURE SetMovieSelection
				(theMovie: Movie; selectionTime: TimeValue; selectionDuration: TimeValue);
PROCEDURE GetMovieSelection 
				(theMovie: Movie; VAR selectionTime: TimeValue; 
				VAR selectionDuration: TimeValue);
FUNCTION CutMovieSelection 	(theMovie: Movie): Movie;
FUNCTION CopyMovieSelection 
				(theMovie: Movie): Movie;
PROCEDURE PasteMovieSelection 
				(theMovie: Movie; src: Movie);
PROCEDURE AddMovieSelection
				(theMovie: Movie; src: Movie);
PROCEDURE ClearMovieSelection 
				(theMovie: Movie);
FUNCTION IsScrapMovie 		(targetTrack: Track): Component;
FUNCTION PasteHandleIntoMovie
				(h: Handle; handleType: OSType; 
				theMovie: Movie; flags: LongInt; 
				userComp: ComponentInstance): OSErr;
FUNCTION PutMovieIntoTypedHandle
				(theMovie: Movie; targetTrack: Track; 
				handleType: OSType; publicMovie: Handle;
				start: TimeValue; dur: TimeValue; 
				flags: long; userComp: ComponentInstance): OSErr;

Undo for Movies

FUNCTION NewMovieEditState (theMovie: Movie): MovieEditState;
FUNCTION UseMovieEditState (theMovie: Movie; toState: MovieEditState): 
				OSErr;
FUNCTION DisposeMovieEditState 
				(state: MovieEditState): OSErr;

Low-Level Movie-Editing Routines

FUNCTION InsertMovieSegment 	(srcMovie: Movie; dstMovie: Movie; 
				srcIn: TimeValue; srcDuration: TimeValue; 
				dstIn: TimeValue): OSErr;
FUNCTION InsertEmptyMovieSegment 
				(dstMovie: Movie; dstIn: TimeValue; dstDuration: TimeValue): OSErr;
FUNCTION DeleteMovieSegment
				(theMovie: Movie; in: TimeValue; 
				duration: TimeValue): OSErr;
FUNCTION ScaleMovieSegment 	(theMovie: Movie; in: TimeValue; 
				oldDuration: TimeValue; 
				newDuration: TimeValue): OSErr;
FUNCTION CopyMovieSettings 	(srcMovie: Movie; dstMovie: Movie): OSErr;

Editing Tracks

FUNCTION InsertTrackSegment
				(srcTrack: Track; dstTrack: Track; 
				srcIn: TimeValue; srcDuration: TimeValue; dstIn: TimeValue): OSErr;
FUNCTION InsertEmptyTrackSegment 
				(dstTrack: Track; dstIn: TimeValue; dstDuration: TimeValue): OSErr;
FUNCTION InsertMediaIntoTrack 
				(theTrack: Track; trackStart: TimeValue; 
				mediaTime: TimeValue; mediaDuration: TimeValue; 
				mediaRate: Fixed): OSErr;
FUNCTION DeleteTrackSegment
				(theTrack: Track; in: TimeValue; 
				duration: TimeValue): OSErr;
FUNCTION ScaleTrackSegment 	(theTrack: Track; in: TimeValue; 
				oldDuration: TimeValue; 
				newDuration: TimeValue): OSErr;
FUNCTION CopyTrackSettings 	(srcTrack: Track; dstTrack: Track): OSErr;
FUNCTION GetTrackEditRate	(theTrack: Track; atTime: TimeValue): Fixed;

Undo for Tracks

FUNCTION NewTrackEditState 	(theTrack: Track): TrackEditState;
FUNCTION UseTrackEditState 	(theTrack: Track; state: TrackEditState): OSErr;
FUNCTION DisposeTrackEditState 
				(state: TrackEditState): OSErr;

Adding Samples to Media Structures

FUNCTION BeginMediaEdits 	(theMedia: Media): OSErr;
FUNCTION EndMediaEdits 		(theMedia: Media): OSErr;
FUNCTION AddMediaSample 	(theMedia: Media; dataIn: Handle; 
				inOffset: LongInt; size: LongInt; 
				durationPerSample: TimeValue; 
				sampleDescriptionH: SampleDescriptionHandle; 
				numberOfSamples: LongInt; 
				sampleFlags: Integer; 
				VAR sampleTime: TimeValue): OSErr;
FUNCTION AddMediaSampleReference 
				(theMedia: Media; dataOffset: LongInt; 
				size: LongInt; durationPerSample: TimeValue; sampleDescriptionH: SampleDescriptionHandle; numberOfSamples: LongInt; 
				sampleFlags: Integer; 
				VAR sampleTime: TimeValue): OSErr;
FUNCTION GetMediaSample 	(theMedia: Media; dataOut: Handle; 
				maxSizeToGrow: LongInt; VAR size: LongInt; 
				time: TimeValue; 
				VAR sampleTime: TimeValue; 
				VAR durationPerSample: TimeValue; 
				sampleDescriptionH: SampleDescriptionHandle; 
				VAR sampleDescriptionIndex: LongInt;
				maxNumberOfSamples: LongInt; 
				VAR numberOfSamples: LongInt; 
				VAR sampleFlags: Integer): OSErr;
FUNCTION GetMediaSampleReference 
(theMedia: Media; VAR dataOffset: LongInt; 
				VAR size: LongInt; time: TimeValue; 
				VAR sampleTime: TimeValue; 
				VAR durationPerSample: TimeValue; sampleDescriptionH: SampleDescriptionHandle; VAR sampleDescriptionIndex: LongInt; maxNumberOfSamples: LongInt; 
				VAR numberOfSamples: LongInt; 
				VAR sampleFlags: Integer): OSErr;

Media Routines

Selecting Media Handlers

PROCEDURE GetMediaHandlerDescription 
				(theMedia: Media; VAR mediaType: OSType; 
				VAR creatorName: Str255; 
				VAR creatorManufacturer: OSType); 
FUNCTION GetMediaHandler 	(theMedia: Media): MediaHandler;
FUNCTION SetMediaHandler 	(theMedia: Media; 
				mH: MediaHandlerComponent): OSErr; 
PROCEDURE GetMediaDataHandlerDescription 
				(theMedia: Media; index: Integer; 
				VAR dhType: OSType; 
				VAR creatorName: Str255;
				VAR creatorManufacturer: OSType); 
FUNCTION GetMediaDataHandler 
				(theMedia: Media; index: Integer): DataHandler;
FUNCTION SetMediaDataHandler 
				(theMedia: Media; index: Integer; 
				dataHandler: DataHandlerComponent)	: OSErr; 

Video Media Handler Routines

FUNCTION SetVideoMediaGraphicsMode 
				(mh: MediaHandler; graphicsMode: LongInt; 
				opColor: RGBColor): HandlerError;
FUNCTION GetVideoMediaGraphicsMode 
				(mh: MediaHandler; VAR graphicsMode: LongInt; 
				VAR opColor: RGBColor): HandlerError;

Sound Media Handler Routines

FUNCTION SetSoundMediaBalance 
				(mh: MediaHandler; 
				balance: Integer): HandlerError;
FUNCTION GetSoundMediaBalance 
				(mh: MediaHandler; 
				VAR balance: Integer): HandlerError;

Text Media Handler Routines

FUNCTION AddTextSample		(mh: MediaHandler; text: Ptr; size: LongInt; 
				fontNumber: Integer; fontSize: Integer; 
				textFace: Style; textColor: RGBColor; 
				backColor: RGBColor; 
				textJustification: Integer; VAR textBox: Rect; 
				displayFlags: LongInt; 
				scrollDelay: TimeValue;
				hiliteStart: Integer; hiliteEnd: Integer; 
				VAR rgbColor: RGBColor;
				duration: TimeValue; 
				VAR sampleTime: TimeValue): ComponentResult;
FUNCTION AddTESample		(mh: MediaHandler; hTE: TEHandle; 
				VAR backColor: RGBColor; 
				textJustification: Integer; VAR textBox: Rect; 
				displayFlags: LongInt; 
				scrollDelay: TimeValue;
				hiliteStart: Integer; hiliteEnd: Integer; 
				VAR rgbColor: RGBColor;
				duration: TimeValue; 
				VAR sampleTime: TimeValue): ComponentResult;
FUNCTION AddHiliteSample	(mh: MediaHandler; hiliteStart: Integer; 
				hiliteEnd: Integer; VAR rgbColor: RGBColor; 
				duration: TimeValue; 
				VAR sampleTime: TimeValue): ComponentResult;
FUNCTION FindNextText 		(mh: MediaHandler; text: Ptr; size: LongInt; 
				findFlags: Integer; startTime: TimeValue;
				VAR foundTime: TimeValue; 
				VAR foundDuration: TimeValue; 
				VAR offset: LongInt): ComponentResult;
FUNCTION HiliteTextSample 	(mh: MediaHandler; sampleTime: TimeValue; 
				hiliteStart: Integer; 
				hiliteEnd: Integer; 
				VAR rgbHiliteColor: RGBColor): ComponentResult;
FUNCTION SetTextProc		(mh: MediaHandler; TextProc: ProcPtr; 
				refcon: LongInt): ComponentResult;

Routines for Creating File Previews

FUNCTION MakeFilePreview 	(resRefNum: Integer;  
				progress: ProgressProcRecordPtr): OSErr;
FUNCTION AddFilePreview 	(resRefNum: Integer; previewType: OSType; 
				previewData: Handle): OSErr;

Routines for Displaying File Previews

PROCEDURE SFGetFilePreview 	(where: Point; prompt: Str255; 
                           	fileFilter: 
				FileFilterProcPtr; 
                           	numTypes: 
				Integer;  typeList: SFTypeList; 
                           	dlgHook: 
				DlgHookProcPtr;   VAR reply: SFReply);
PROCEDURE SFPGetFilePreview
				(where: Point; prompt: Str255; 
				fileFilter: FileFilterProcPtr; 
				numTypes: Integer; typeList: SFTypeList; 
				dlgHook: DlgHookProcPtr; VAR reply: SFReply; dlgID: Integer; filterProc: ModalFilterProcPtr);
PROCEDURE StandardGetFilePreview
				(fileFilter: FileFilterProcPtr; 
				numTypes: Integer; typeList: SFTypeList; 
				VAR reply: StandardFileReply);
PROCEDURE CustomGetFilePreview
				(fileFilter: FileFilterYDProcPtr; 
				numTypes: Integer; typeList: SFTypeList; 
				VAR reply: StandardFileReply; dlgID: Integer; where: Point; dlgHook: DlgHookYDProcPtr; 
				filterProc: ModalFilterYDProcPtr; 
				activeList: Ptr; 
				activateProc: ActivateYDProcPtr; 
				yourDataPtr: UNIV Ptr);

Time Base Routines

Creating and Disposing of Time Bases

FUNCTION NewTimeBase: 		TimeBase;
PROCEDURE DisposeTimeBase 	(tb: TimeBase);
PROCEDURE SetMovieMasterClock 
				(theMovie: Movie; clockMeister: Component; 
				slaveZero: TimeRecord);
PROCEDURE SetMovieMasterTimeBase 
				(theMovie: Movie; tb: TimeBase; 
				slaveZero: TimeRecord);
PROCEDURE SetTimeBaseMasterClock 
				(slave: TimeBase; clockMeister: Component; 
				slaveZero: TimeRecord);
FUNCTION GetTimeBaseMasterClock 
				(tb: TimeBase): ComponentInstance;
PROCEDURE SetTimeBaseMasterTimeBase 
				(slave: TimeBase; master: TimeBase; 
				slaveZero: TimeRecord);
FUNCTION GetTimeBaseMasterTimeBase 
				(tb: TimeBase): TimeBase;
PROCEDURE SetTimeBaseZero	 (tb: TimeBase; VAR zero: TimeRecord);

Working With Time Base Values

PROCEDURE SetTimeBaseTime 	(tb: TimeBase; tr: TimeRecord);
PROCEDURE SetTimeBaseValue 	(tb: TimeBase; t: TimeValue; s: TimeScale);
FUNCTION GetTimeBaseTime 	(tb: TimeBase; s: TimeScale; 
				VAR tr: TimeRecord): TimeValue;
PROCEDURE SetTimeBaseRate 	(tb: TimeBase; r: Fixed);
FUNCTION GetTimeBaseRate 	(tb: TimeBase): Fixed;
FUNCTION GetTimeBaseEffectiveRate
				(tb: TimeBase): Fixed;
PROCEDURE SetTimeBaseStartTime 
				(tb: TimeBase; VAR tr: TimeRecord);
FUNCTION GetTimeBaseStartTime 
				(tb: TimeBase; s: TimeScale; 
				tr: TimeRecord): TimeValue;
PROCEDURE SetTimeBaseStopTime 
				(tb: TimeBase; VAR tr: TimeRecord);
FUNCTION GetTimeBaseStopTime 
				(tb: TimeBase; s: TimeScale; 
				tr: TimeRecord): TimeValue;
PROCEDURE SetTimeBaseFlags 	(tb: TimeBase; timeBaseFlags: LongInt);
FUNCTION GetTimeBaseFlags 	(tb: TimeBase): LongInt;
FUNCTION GetTimeBaseStatus 	(tb: TimeBase; 
				VAR unpinnedTime: TimeRecord): LongInt;

Working With Times

PROCEDURE AddTime 	(VAR dst: TimeRecord; src: TimeRecord);
PROCEDURE SubtractTime 	(VAR dst: TimeRecord; src: TimeRecord);
PROCEDURE ConvertTime 	(VAR inout: TimeRecord; newBase: TimeBase);
PROCEDURE ConvertTimeScale (VAR inout: TimeRecord; newScale: TimeScale);

Time Base Callback Routines

FUNCTION NewCallBack 		(tb: TimeBase; cbType: Integer): QTCallBack; 
FUNCTION CallMeWhen 		(cb: QTCallBack; callBackProc: QTCallBackProc; 
				refcon: LongInt; param1: LongInt; 
				param2: LongInt; param3: LongInt): OSErr;
PROCEDURE CancelCallBack 	(cb: QTCallBack);
PROCEDURE DisposeCallBack 	(cb: QTCallBack);
FUNCTION GetCallBackTimeBase
				(cb: QTCallBack): TimeBase;
FUNCTION GetCallBackType 	(cb: QTCallBack): Integer;

Matrix Routines

PROCEDURE SetIdentityMatrix
				(VAR matrix: MatrixRecord);
FUNCTION GetMatrixType 	(m: MatrixRecord): Integer;
PROCEDURE CopyMatrix 	(m1: MatrixRecord; VAR m2: MatrixRecord);
FUNCTION EqualMatrix 	(m1: MatrixRecord; m2: MatrixRecord): Boolean;
PROCEDURE TranslateMatrix 	(VAR m: MatrixRecord; deltaH: Fixed; 
				deltaV: Fixed);
PROCEDURE ScaleMatrix 	(VAR m: MatrixRecord; scaleX: Fixed; 
				scaleY: Fixed; aboutX: Fixed; aboutY: Fixed);
PROCEDURE RotateMatrix 	(VAR m: MatrixRecord; degrees: Fixed; 
				aboutX: Fixed; aboutY: Fixed);
PROCEDURE SkewMatrix 	(VAR m: MatrixRecord; skewX: Fixed; 
				skewY: Fixed; aboutX: Fixed; aboutY: Fixed);
PROCEDURE ConcatMatrix 	(a: MatrixRecord; VAR b: MatrixRecord);
FUNCTION InverseMatrix 	(m: MatrixRecord; 
				VAR im: MatrixRecord): Boolean;
FUNCTION TransformPoints 	(mp: MatrixRecord; VAR pt1: Point; 
				count: LongInt): OSErr;
FUNCTION TransformFixedPoints 
				(m: MatrixRecord; VAR fpt: FixedPoint; 
				count: LongInt): OSErr;
FUNCTION TransformRect 		(m: MatrixRecord; VAR r: Rect; 
				VAR fpp: FixedPoint): Boolean;
FUNCTION TransformFixedRect 	(m: MatrixRecord; VAR fr: FixedRect; 
				VAR fpp: FixedPoint): Boolean;
FUNCTION TransformRgn 	(mp: MatrixRecord; r: RgnHandle): OSErr;
PROCEDURE RectMatrix 	(VAR matrix: MatrixRecord; srcRect: Rect; 
				dstRect: Rect);
PROCEDURE MapMatrix 	(VAR matrix: MatrixRecord; fromRect: Rect; 
				toRect: Rect);

Application-Defined Routines

Progress Routines

FUNCTION MyProgressProc 	(theMovie: Movie; message: Integer; 
				whatOperation: Integer; 
                           	percentDone: 
				Fixed;        refcon: LongInt): OSErr;

Cover Routines

FUNCTION MyCoverProc 	(theMovie: Movie; changedRgn: RgnHandle; 
               		refcon: LongInt): OSErr;

Error-Notification Routines

PROCEDURE MyErrProc 	(theErr: OSErr; refcon: LongInt);

Movie Callout Routines

FUNCTION MyCallOutProc 	(refcon: long): Boolean;

File Filter Routines

FUNCTION MyFileFilter 	(paramBlock: ParmBlkPtr): Boolean;

Custom Routines

FUNCTION MyDlgHook (item: Integer; theDialog: DialogPtr; myDataPtr: Ptr): Integer;

Modal-Dialog Filter Routines

FUNCTION MyModalFilter 	(theDialog: DialogPtr; 
                     	VAR theEvent: 
			EventRecord;       itemHit: Integer; 
                          myDataPtr: 
			Ptr): Boolean;

Standard File Activation Routines

PROCEDURE MyActivateProc (theDialog: DialogPtr; itemNo: Integer; 
                                    
				activating: Boolean; myDataPtr: 
				Ptr);

Callback Event Routines

PROCEDURE MyCallBackProc 	(cb: QTCallBack; refcon: LongInt);

Text Routines

PROCEDURE MyTextProc 	(theText: Handle; theMovie: Movie; 
			VAR displayFlag: Integer; refcon: LongInt); 

Result Codes

couldNotResolveDataRef-2000Cannot use this data reference
badImageDescription-2001Problem with this image description
badPublicMovieAtom-2002Movie file corrupted
cantFindHandler-2003Cannot locate this handler
cantOpenHandler-2004Cannot open this handler
badComponentType-2005Component cannot accommodate this data
noMediaHandler-2006Media has no media handler
noDataHandler-2007Media has no data handler
invalidMedia-2008This media is corrupted or invalid
invalidTrack-2009This track is corrupted or invalid
invalidMovie-2010This movie is corrupted or invalid
invalidSampleTable-2011This sample table is corrupted or invalid
invalidDataRef-2012This data reference is invalid
invalidHandler-2013This handler is invalid
invalidDuration-2014This duration value is invalid
invalidTime-2015This time value is invalid
cantPutPublicMovieAtom-2016Cannot write to this movie file
badEditList-2017The track's edit list is corrupted
mediaTypesDontMatch-2018These media don't match
progressProcAborted-2019Your progress procedure returned an error
movieToolboxUninitialized-2020You haven't initialized the Movie Toolbox
wfFileNotFound-2021Cannot locate this file
cantCreateSingleForkFile-2022Error trying to create a single-fork file. This occurs when the file already exists.
invalidEditState-2023This edit state is invalid
nonMatchingEditState-2024This edit state is not valid for this movie
staleEditState-2025Movie or track has been disposed
userDataItemNotFound-2026Cannot locate this user data item
maxSizeToGrowTooSmall-2027Maximum size must be larger
badTrackIndex-2028This track index value is not valid
trackIDNotFound-2029Cannot locate a track with this ID value
trackNotInMovie-2030This track is not in this movie
timeNotInTrack-2031This time value is outside of this track
timeNotInMedia-2032This time value is outside of this media
badEditIndex-2033This edit index value is not valid
internalQuickTimeError-2034Internal error
cantEnableTrack-2035Cannot enable this track
invalidRect-2036Specified rectangle has invalid coordinates
invalidSampleNum-2037There is no sample with this sample number
invalidChunkNum-2038There is no chunk with this chunk number
invalidSampleDescIndex-2039Sample description index value invalid
invalidChunkCache-2040The chunk cache is corrupted
invalidSampleDescription-2041This sample description is invalid or corrupted
dataNotOpenForRead-2042Cannot read from this data source
dataNotOpenForWrite-2043Cannot write to this data source
dataAlreadyOpenForWrite-2044Data source is already open for write
dataAlreadyClosed-2045You have already closed this data source
endOfDataReached-2046End of data
dataNoDataRef-2047No data reference value found
noMovieFound -2048Toolbox cannot find a movie in the movie file
invalidDataRefContainer-2049Invalid data reference
badDataRefIndex-2050Data reference index value is invalid
noDefaultDataRef-2051Could not find a default data reference
couldNotUseAnExistingSample-2052Movie Toolbox could not use a sample
featureUnsupported-2053Movie Toolbox does not support this feature


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996